package main

import "fmt"

func main() {

	//f1 := createFunc()
	//fmt.Println(f1())
	//f2 := createFunc()
	//fmt.Println(f2())

	fs := create()

	for i := 0; i < len(fs); i++ {
		fs[i]()
	}
}

func createFunc() func() int {
	c := 2
	return func() int {
		return c
	}
}

func create() (fs [2]func()) {
	for i := 0; i < 2; i++ {
		fs[i] = func() {
			fmt.Println(i)
		}
	}
	return
}
